/**
 * 
 */
package com.naiterui.ehp.bs.recommend.enums;

import org.apache.commons.lang3.StringUtils;


/**
 * 用药周期单位

 * @since 2.19
 */
public enum DrugCycleUnitEnum {
    HOUR ("小时"),
    DAY ("天"),
    DAY_ALIAS ("日"),
    WEEK ("周"),
    MONTH ("月");
    private String value;

    DrugCycleUnitEnum(String value) {
        this.value = value;
    }

    public String getValue() {
        return this.value;
    }


    public static DrugCycleUnitEnum valuesOf(String unit) {
        if (StringUtils.isEmpty(unit)) {
            return null;
        }
        DrugCycleUnitEnum[] totalEnums = DrugCycleUnitEnum.class.getEnumConstants();
        for (DrugCycleUnitEnum tempEnum : totalEnums) {
            if (tempEnum.getValue().equals(unit)) {
                return tempEnum;
            }
        }
        return null;
    }
}
